<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>楼栋管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){

					$.ajax({
						url: ctx +"/pro/basBuilding/save",
						data:$("#inputForm").serialize(),
						success: function(data){
							if(data.code==0){
								console.log(data)
								parent.location.reload();
							}else{
								layer.msg(data.message);
							}
						}
					})
					// loading('正在提交，请稍等...');
					// form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
<%--	<ul class="nav nav-tabs">--%>
<%--		<li><a href="${ctx}/pro/basBuilding/">楼栋管理列表</a></li>--%>
<%--		<li class="active"><a href="${ctx}/pro/basBuilding/form?id=${basBuilding.id}">楼栋管理<shiro:hasPermission name="pro:basBuilding:edit">${not empty basBuilding.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="pro:basBuilding:edit">查看</shiro:lacksPermission></a></li>--%>
<%--	</ul><br/>--%>
	<form:form id="inputForm" modelAttribute="basBuilding" action="${ctx}/pro/basBuilding/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">楼栋名称：</label>
			<div class="controls">
				<form:input path="buildingName" htmlEscape="false" maxlength="10" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">楼栋编号：</label>
			<div class="controls">
				<form:input path="buildingNumber" htmlEscape="false" maxlength="10" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">楼栋经理：</label>
			<div class="controls">
				<form:input path="buildingManager" htmlEscape="false" maxlength="10" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否入住：</label>
			<div class="controls">
				<input type="radio" name="moveIntoFlag" ${basBuilding.moveIntoFlag==1?'checked':''} value="1">是
				<input type="radio" name="moveIntoFlag" ${basBuilding.moveIntoFlag==0?'checked':''} value="0">否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">建筑日期：</label>
			<div class="controls">
				<input name="constructionDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${basBuilding.constructionDate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注信息：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
<%--		<div class="form-actions">--%>
<%--			<shiro:hasPermission name="pro:basBuilding:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>--%>
<%--			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>--%>
<%--		</div>--%>
	</form:form>
</body>
</html>